
#pragma once

#include <Reload/stdafx.h>
#include <Reload/ConstDef.h>
#include <Reload/ReloadCode.h>
#include <Reload/ReloadApp.h>
#include <Reload/ReloadPacket.h>
#include <Reload/ReloadOverlay.h>
#include <Reload/ReloadConfigure.h>
#include <Reload/ReloadNetworkDataHandler.h>

namespace reload
{
	typedef struct StartReloadAppParamStruct
	{
		std::vector<log4cxx::AppenderPtr> extraLoggerAppenders_;
	} StartReloadAppParam;

	ResourceId getResourceIdFromStringBySHA1(const char* sInput);

	retT startReloadApp(const char* _configureFilePath, const StartReloadAppParam* _pStartReloadAppParam = NULL );

	bool isReloadAppStarted();

	retT waitReloadAppToStart();

	retT stopReloadApp(int _isBlock);

	retT waitReloadAppToQuit();

	void onQuit();

	retT sendStoreReq(std::string _overlayInstanceName, const ResourceId& _resourceId, const asyframe::StructVarArray<asyframe::uint32, StoreKindData>& _kindData, UserCallBackType _userCallBack = NULL);
	retT sendStoreReq(std::string _overlayInstanceName, const char* _resourceName, const asyframe::StructVarArray<asyframe::uint32, StoreKindData>& _kindData, UserCallBackType _userCallBack = NULL);

	retT sendFetchReq(std::string _overlayInstanceName, const ResourceId& _resourceId, const asyframe::StructVarArray<asyframe::uint16, StoredDataSpecifier>& _specifiers, UserCallBackType _userCallBack = NULL);
	retT sendFetchReq(std::string _overlayInstanceName, const char* _resourceName, const asyframe::StructVarArray<asyframe::uint16, StoredDataSpecifier>& _specifiers, UserCallBackType _userCallBack = NULL);

	retT sendAppAttachReq(std::string _overlayInstanceName, const Destination& _destination, UserCallBackType _userCallBack = NULL);
	retT sendAppAttachReq(std::string _overlayInstanceName, const char* _resourceName, UserCallBackType _userCallBack = NULL);
} /*namespace reload*/
